<?php

namespace common\models\ar;

use Yii;

/**
 * This is the model class for table "templates_detail".
 *
 * @property int $id
 * @property int $template_id 模板ID
 * @property string $product 品种名称
 * @property string $trade_cost_open 开仓手续费
 * @property string $trade_cost_close 平仓手续费
 */
class TemplatesDetail extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'templates_detail';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['template_id'], 'integer'],
            [['trade_cost_open', 'trade_cost_close'], 'number'],
            [['product'], 'string', 'max' => 16],
            [['template_id', 'product'], 'unique', 'targetAttribute' => ['template_id', 'product']],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'template_id' => '模板ID',
            'product' => '品种名称',
            'trade_cost_open' => '开仓手续费',
            'trade_cost_close' => '平仓手续费',
        ];
    }
}
